<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>大小</title>
        <script src="https://unpkg.com/vue@3.5.13"></script>
    </head>
    <body>
        <div id="Application">
            <div>{{typeFunc}}</div>
            <button @click="add">Add</button>
        </div>

        <script>
            const Application = {
                // 数据
                data() {
                    return {
                        count: 0
                    }
                },
                computed: {
                    type() {
                        return this.count > 0 ? "big" : "small"
                    }
                },
                methods: {
                    add() {
                        this.count++
                    },
                    typeFunc() {
                        return this.count > 0 ? "big" : "small"
                    }
                }
            }
            // 创建应用,挂载到id为Application的元素上
            Vue.createApp(Application).mount('#Application')
        </script>
    </body>
</html>